package com.gopay.common.domain.riskcontrol;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 风控银行卡订单明细表
 * @RcBankcardOrderDtl.java
 * @author zhuliang
 * @2017年5月12日 上午14:42:48  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "RC_BANKCARD_ORDER_DTL")
public class RcBankcardOrderDtl extends BaseEntity{


	private static final long serialVersionUID = 1367817998711079082L;

	/**
	 * 主键
	 */
	@Id
	@Column(name = "GOPAY_ORDER_ID", unique = true, nullable = false, length = 30)
	private String gopayOrderId;

	/**
	 * 内部交易码
	 */
	@Column(name="INT_TXN_CD",nullable = false,length = 6)
	private String intTxnCd;

	/**
	 * 银行卡号
	 */
	@Column(name="BANK_CARD_HASH", length = 100)
	private String bankCardHash;

	/**
	 * 银行卡号密文
	 */
	@Column(name="BANK_CARD_CIPHER", length = 500)
	private String bankCardCipher;


	/**
	 * 交易金额
	 */
	@Column(name = "MER_TXN_AMT", precision = 20, scale = 2)
	private BigDecimal merTxnAmt;

	/**
	 * 国付宝服务器时间
	 */
	@Column(name="GOPAY_TXN_TM",nullable = false)
	private Date gopayTxnTm;


	/**
	 * 订单状态
	 */
	@Column(name="STAT", length = 2)
	private String stat;


	/**
	 * 创建人
	 */
	@Column(name="CREATE_OPER_ID")
	private String createOperId;

	/**
	 * 创建时间
	 */
	@Column(name="CREATED_TS")
	private Date createdTs;

	/**
	 * 最后修改人
	 */
	@Column(name="LAST_UPD_OPER_ID")
	private String lastUpdOperId;

	/**
	 * 最后修改时间
	 */
	@Column(name="LAST_UPD_TS")
	private Date lastUpdTs;

	/**
	 * 乐观锁版本号
	 */

	@Column(name="VERSION")
	private Integer version;


	public String getGopayOrderId() {
		return gopayOrderId;
	}

	public void setGopayOrderId(String gopayOrderId) {
		this.gopayOrderId = gopayOrderId;
	}

	public String getIntTxnCd() {
		return intTxnCd;
	}

	public void setIntTxnCd(String intTxnCd) {
		this.intTxnCd = intTxnCd;
	}

	public String getBankCardHash() {
		return bankCardHash;
	}

	public void setBankCardHash(String bankCardHash) {
		this.bankCardHash = bankCardHash;
	}

	public String getBankCardCipher() {
		this.bankCardCipher = SensitiveInfoUtils.autoReencrypt(this.bankCardCipher);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.bankCardCipher);
	}

	public void setBankCardCipher(String bankCardCipher) {
		this.bankCardCipher = SensitiveInfoUtils.smartEncryptWithCheck(bankCardCipher);
	}

	public BigDecimal getMerTxnAmt() {
		return merTxnAmt;
	}

	public void setMerTxnAmt(BigDecimal merTxnAmt) {
		this.merTxnAmt = merTxnAmt;
	}
	public Date getGopayTxnTm() {
		return gopayTxnTm;
	}

	public void setGopayTxnTm(Date gopayTxnTm) {
		this.gopayTxnTm = gopayTxnTm;
	}

	public String getStat() {
		return stat;
	}

	public void setStat(String stat) {
		this.stat = stat;
	}

	public String getCreateOperId() {
		return createOperId;
	}

	public void setCreateOperId(String createOperId) {
		this.createOperId = createOperId;
	}

	public Date getCreatedTs() {
		return createdTs;
	}

	public void setCreatedTs(Date createdTs) {
		this.createdTs = createdTs;
	}

	public String getLastUpdOperId() {
		return lastUpdOperId;
	}

	public void setLastUpdOperId(String lastUpdOperId) {
		this.lastUpdOperId = lastUpdOperId;
	}

	public Date getLastUpdTs() {
		return lastUpdTs;
	}

	public void setLastUpdTs(Date lastUpdTs) {
		this.lastUpdTs = lastUpdTs;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}



}
